home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / gemfsc15.lzh / AESSRC14.LZH / AESUTOB5.S < prev    next >
Text File  |  1990-05-27  |  2KB  |  55 lines

  1.  
  2. ;*========================================================================
  3. ;*
  4. ;* AESFAST Public Domain GEM bindings.
  5. ;*  
  6. ;* Maintenance:
  7. ;*  05/26/90 - v1.4: This module is new with this release.
  8. ;*========================================================================
  9.  
  10. ;*************************************************************************
  11. ;*
  12. ;* AESUTOB5.S - Object-related utilities 5 of n.
  13. ;*  Non-standard utility functions.
  14. ;*
  15. ;*************************************************************************
  16.          
  17.           .include  "gemfast.sh"        ; Pull in header file.
  18.  
  19. ;-------------------------------------------------------------------------
  20. ; obj_xtfind - Return index of object with specified extended object type.
  21. ;
  22. ;  int obj_rbfind(tree, parentobj, state);
  23. ;
  24. ;|v1.4: This routine is new with this release.
  25. ;-------------------------------------------------------------------------
  26.  
  27. _obj_xtfind::
  28.  
  29.           cargs     #4,.ptree.l,.parent.w,.xtype.w
  30.           
  31.           exg       a1,d3                       ; save d3 in a1
  32.           
  33.           move.l    .ptree(sp),a0
  34.           move.w    .xtype(sp),d2
  35.           move.w    .parent(sp),d3
  36.           move.w    d3,d0
  37.           muls      #OBJ_SIZ,d0
  38.           move.w    ob_head(a0,d0.l),d0
  39.           ble.s     .notfound
  40. .loop:
  41.           move.w    d0,d1
  42.           muls      #OBJ_SIZ,d1
  43.           cmp.b     ob_type(a0,d1.l),d2
  44.           beq.s     .done
  45.           move.w    ob_next(a0,d1.l),d0
  46.           cmp.w     d0,d3
  47.           bne.s     .loop
  48. .notfound:
  49.           moveq.l   #-1,d0
  50. .done:
  51.           exg       a1,d3               ; restore d3 from a1
  52.           tst.w     d0                  ; insure CCR return matches d0
  53.           rts
  54.  
  55.